<?php
class Solicitudes_Form_Informacion extends Form_Base{
	
	public function __construct($options = null) {
		parent::__construct($options);
	}
	
	public function init($a=false) {
		$domConfig = Zend_Registry::get('domConfig');
		$appConfig = Zend_Registry::get('appConfig');
		
		$this->setName('sintesis');
		$this->setMethod("post");
		$this->setEnctype('multipart/form-data');
		
		$array_elements[] = new Zend_Form_Element_Hidden("codseccionlista");
		$array_elements[] = new Zend_Form_Element_Hidden("codtramiteseccion");
		      
        $element = new Zend_Form_Element_Text("textosintesis");
        $element->helper = "formNote";
//        $element->addFilter('StringToUpper');
        $array_elements[] = $element;
		
		$element = new Zend_Form_Element_Textarea('sintesis');
//		$element->setLabel('Síntesis :');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
//		$element->addFilter('StringToUpper');
		$element->setAttrib("rows",20);
		$element->setAttrib("style","width:99%");
		$element->addValidator('StringLength', false, array($domConfig->TEXTO_TAMANOMIN));
		$array_elements[] = $element;
		
		$element = new Zend_Form_Element_File('archivo');
		$element->setLabel('Adjuntar archivo :');
        $element->setMaxFileSize(10485760);
		$element->addValidator('Size', false, 10485760); // 10MB = 10,485,760 bytes
        $element->setDestination($appConfig->get("ruta_archivos"));
        $element->setRequired(false);
        $element->setValueDisabled(true);
        $element->addValidator('Extension', false, $domConfig->EXTENSIONES_ARCHIVOS);
        $array_elements[] = $element;
        		
		$element = new Zend_Form_Element_Submit ( 'btnSubmit' );
		$element->setValue('Guardar');
		$element->setLabel("Guardar");
		$element->setAttrib("class", "iceCmdBtn");
		$array_elements[] = $element;
		
		$this->addElements($array_elements);
		
		$this->loadViewScriptDecorators();
//		$this->loadTableDecorators();
	}
	
	public function loadViewScriptDecorators() {
		$this->setDecorators ( array (array ('viewScript', array ('viewScript' => 'viewscripts/informacion_form.phtml' ) ) ) );
	}
}